//
//  ECCommonDefine.h
//  ERPChargeAccount
//
//  Created by huanggulong on 2018/5/3.
//  Copyright © 2018年 历山大亚. All rights reserved.
//

#ifndef ECCommonDefine_h
#define ECCommonDefine_h

//判断是否是ipad
#define IS_iPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

//判断iPhoneX
#define IS_IPHONE_X ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !IS_iPad : NO)
//判断iPHoneXr
#define IS_IPHONE_Xr ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(828, 1792), [[UIScreen mainScreen] currentMode].size) && !IS_iPad : NO)
//判断iPhoneXs
#define IS_IPHONE_Xs ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) && !IS_iPad : NO)
//判断iPhoneXs Max
#define IS_IPHONE_Xs_Max ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2688), [[UIScreen mainScreen] currentMode].size) && !IS_iPad : NO)


//手机操作系统
#define iOS7Later ([UIDevice currentDevice].systemVersion.doubleValue >= 7.0)
#define iOS8Later ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)
#define iOS7 (iOS7Later & !iOS8)
#define iOS(index , sign) ([UIDevice currentDevice].systemVersion.doubleValue sign index)

//自定义输出ECog     调试阶段有输出,真机阶段无输出
#ifdef DEBUG
#define ECLog(...) NSLog(__VA_ARGS__)
#else
#define ECLog(...)
#endif

#define WS(weakSelf,var1)  __weak __typeof(var1) weakSelf = var1

#define ECSTRONG(name,var1)  __strong __typeof(var1) name = var1

#define ECSCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height    // 获取屏幕的高度
#define ECSCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width      // 获取屏幕的宽度

//iPhoneX系列
#define Height_StatusBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 44.0 : 20.0)   //状态栏高度
#define Height_NavBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 88.0 : 64.0)   //导航栏高度
#define Height_TabBar ((IS_IPHONE_X==YES || IS_IPHONE_Xr ==YES || IS_IPHONE_Xs== YES || IS_IPHONE_Xs_Max== YES) ? 83.0 : 49.0)   //工具栏高度


#define kScaleH    (ECSCREEN_HEIGHT/667.0)
#define kScaleW    (ECSCREEN_WIDTH/375.0)


#define ECAPPDelegate ((AppDelegate*)([UIApplication sharedApplication].delegate))

#define PX_RELATIVE375 ECSCREEN_WIDTH / 375

#define ECRootViewControllerNotification  @"ECRootViewControllerNotification"

#define ECINDENTATION_LEFT ((24) * PX_RELATIVE375)

#pragma mark - color
#import <YYKit/UIColor+YYAdd.h>
//YYKit颜色方法
#define ECCOLOR(rgb) [UIColor colorWithRGB:(rgb)]
//文本输入框下划线颜色
#define ECCOLOR_TEXTBOTTOMLINE ECCOLOR(0xcccccc)
//导航栏颜色
#define ECCOLOR_NAVIBACK ECCOLOR(0x00A61E)
//字体颜色-大标题
#define ECCOLOR_FONT_HEADLINE ECCOLOR(0x333333)
//字体颜色-标题
#define ECCOLOR_FONT_TITLE ECCOLOR(0x303030)
//字体颜色-内容、说明
#define ECCOLOR_FONT_EXPLAIN ECCOLOR(0x999999)
//按钮disable 颜色
#define ECCOLOR_BTDISABLE ECCOLOR(0xC1CED3)

//按钮enable梯度颜色起始
#define ECCOLOR_BTENABLESTART ECCOLOR(0x18C0EB)
//按钮enable梯度颜色结束
#define ECCOLOR_BTENABLEEND ECCOLOR(0x1790D4)

#pragma mark -font
//字体
#define ECFONT(size) [UIFont systemFontOfSize:(size)]

#define ECBOLDFONT(size) [UIFont boldSystemFontOfSize:(size)]
//大标题字体尺寸
#define ECFONT_HEADLINE ECFONT(30)

#endif /* ECCommonDefine_h */
